<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>鸡兔同笼</title>
	<script type="text/javascript">
		var a=prompt("请输入头数","");
		var b=prompt("请输入脚数","");
		var n1=(b-2*a)/2;
		var n2=a-n1;
		document.write(n2+"&nbsp;"+n2);
		//var n1,n2;
		for(n1=0;n1<b/2;n1++){
			for(n2=0;n2<b/4;n2++){
				if(n1+n2==a&& 2*n1+4*n2==b){
					document.write(n2+"&nbsp;"+n2);
				}
			}
		}
	</script>
</head>
<body>
</body>
</html>